<template>
  <div id="app">
    <div class="sub-title">激活即列出输入建议</div>
    <el-autocomplete
      v-model="state"
      :fetch-suggestions="querySearch"
      @select="handleSelect"
    ></el-autocomplete>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      state: "",
    };
  },
  methods: {
    handleSelect:function(value){
      console.log(value);
    },
    querySearch:function(queryString,cb){
      cb([
        {
          value:"哈哈"
        },
        {
          value:"呵呵"
        }
      ])
    }
  },
};
</script>

<style lang="less" scoped>
</style>